package com.csmht.tododemo.mapper;

import com.csmht.tododemo.annotation.AutoFill;
import com.csmht.tododemo.pojo.dto.ClassDTO;
import com.csmht.tododemo.pojo.entity.ClassEntity;
import com.csmht.tododemo.pojo.entity.TodoClass;
import com.csmht.tododemo.pojo.enumeration.OperationType;
import com.csmht.tododemo.pojo.vo.ClassVO;
import com.csmht.tododemo.result.Result;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ClassMapper {


    List<TodoClass> selectByIds(List<Long> a);

    @AutoFill(OperationType.ONE)
    void insert(ClassEntity classDTO);

    void deleteByIds(List<Long> ids);

    @Select("select id,name,create_time from class where create_user = #{userId}")
    List<ClassVO> selectByUserId(Long userId);


    List<TodoClass> selectByToDoId(Long id);


}
